package com.anda.logistics.action;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import javax.annotation.Resource;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;

import com.anda.logistics.service.FreightSourceService;
import com.anda.logistics.service.TruckInfoService;


@ParentPackage("json-default")
public class ManagerHomeAction extends AndaBaseAction {

	private static final long serialVersionUID = 499512329780240148L;
	private TruckInfoService truckInfoService;
	private FreightSourceService freightSourceService;
	private List<ArrayList> truckList;
	private List<ArrayList> freightList;
	
	@Action(value="/manager/home",
			results=@Result(name="success",location="home.jsp")
	)
	public String execute(){
		truckList = truckInfoService.getTruckCountByProvince();
		//List<ArrayList> tiList = truckInfoService.getTruckCountByProvince();
		freightList = freightSourceService.getFreightCountByProvince();		
		
		
		return SUCCESS;
	}

	public TruckInfoService getTruckInfoService() {
		return truckInfoService;
	}
	@Resource
	public void setTruckInfoService(TruckInfoService truckInfoService) {
		this.truckInfoService = truckInfoService;
	}

	public List<ArrayList> getTruckList() {
		return truckList;
	}

	public void setTruckList(List<ArrayList> truckList) {
		this.truckList = truckList;
	}

	public List<ArrayList> getFreightList() {
		return freightList;
	}

	public void setFreightList(List<ArrayList> freightList) {
		this.freightList = freightList;
	}

	public FreightSourceService getFreightSourceService() {
		return freightSourceService;
	}
	@Resource
	public void setFreightSourceService(FreightSourceService freightSourceService) {
		this.freightSourceService = freightSourceService;
	}
	
}
